{include file="pub_header.htm"}

<div class="out_table">
<table width="100%" cellpadding="3" cellspacing="0" border="0" align="center" class="current_place">
  <tr>
    <td align="left" nowrap>&nbsp;
      <a href="{$lang.s._public.global.weburl}" target="_self" class="current_place">{$lang.s._public.global.website}</a>
      &raquo; <a href="{$control_index}?act=index" target="_self" class="current_place">论坛首页</a>
      {foreach name=channel_current from=$channel_current item=channel_current}
      &raquo; <a href="{$control_index}?act=channel&channel_id={$channel_current.id}" target="_self" class="current_place">{$channel_current.name|str_entag:'space,br'}</a>
      {/foreach}
      &raquo; <a href="{$control_index}?act=topic&topic_id={$topic_info.id}" target="_self" class="current_place">{$topic_info.subject|str_cut:0:30:"..."|str_entag:"space"}</a>
      &raquo; <a href="{$control_index}?act=edit&ope=edit&topic_id={$topic_info.id}&post_id={$post_info.id}" target="_self" class="current_place">编辑回帖</a>
    </td>
    <td align="right" nowrap>&nbsp;</td>
  </tr>
</table>
</div>

<div class="out_table"><div class="space"></div></div>
<div class="out_table">
{if $get.ope == "edit"}
<form id="form_edit" name="form_edit" method="post" action="javascript:void(null);" enctype="multipart/form-data">
<table width="98%" cellpadding="3" cellspacing="0" border="0" align="center" class="block_group">
  <tr align="left" class="block_header">
    <td colspan="2">编辑帖子:<a href="{$control_index}?act=topic&topic_id={$topic_info.id}" target="_blank">{$topic_info.subject|str_entag:"space"}</a></td>
  </tr>
  <tr>
    <td width="20%" class="block_left">回帖内容:</td>
    <td width="80%" class="block_right">
      {assign var="content_value" value=$post_info.content}
      {assign var="content_rows" value="15"}
      {assign var="content_cols" value="120"}
      {include file="pub_content_editor.htm"}
      <span id="content_return"><span class="prompt_primal"></span></span>
    </td>
  </tr>
  <tr>
    <td class="block_left" valign="top"><br />附件上传</td>
    <td class="block_right">
    <table width="90%" border="0" cellspacing="0" cellpadding="1" bgcolor="#FDF4E3">
      <tr>
        <td colspan="6" align="left">
          允许的文件类型:[{$setting_attach.type|implode_str:"|"}]
        </td>
      </tr>
      <tr>
        <td width="5%" rowspan="2" align="center"><b>描<br />述</b></td>
        <td width="25%" rowspan="2" align="left"><textarea id="attach_brief" name="attach_brief" rows="2" cols="24" class="textarea"></textarea></td>
        <td width="5%" rowspan="2" align="center"><b>文<br />件</b></td>
        <td width="25%" align="left">
          <span id="attach_upload_input" name="attach_upload_input">
            <input type="file" id="attach_upload" name="attach_upload" size="12" style="width:140px;" class="input" />
          </span>
        </td>
        <td width="10%" align="left">
          <input type="button" id="attach_upload_submit" name="attach_upload_submit" value="本地上传" class="button" onclick="xajax.$('attach_upload_submit').disabled=true;xajax_upload_submit('form_edit','{$control_index}?act=edit&ope=saveattach_upload&topic_id={$topic_info.id}&post_id={$post_info.id}','attach_upload_prompt');">
        </td>
        <td width="30%" align="left">
          <span id="attach_upload_prompt" name="attach_upload_prompt"></span>
        </td>
      </tr>
      <tr>
        <td width="25%" align="left">
          <span id="attach_get_input" name="attach_get_input">
            <input type="text" id="attach_get" name="attach_get" size="24" style="width:140px;" class="input" />
          </span>
        </td>
        <td width="10%" align="left">
          <input type="button" id="attach_get_submit" name="attach_get_submit" value="地址获取" class="button" onclick="xajax.$('attach_get_submit').disabled=true;xajax_attach_get('amend','{$post_info.id}','attach_get',attach_get.value,'attach_get_submit','attach_list','attach_brief',attach_brief.value,'attach_get_prompt');">
        </td>
        <td width="30%" align="left">
          <span id="attach_get_prompt" name="attach_get_prompt"></span>
        </td>
      </tr>
      <tr>
        <td colspan="6" align="left">
          <span id="attach_list" name="attach_list">{$attach_list_result}</span>
        </td>
      </tr>
    </table>
    </td>
  </tr>
  <tr>
    <td class="block_left">发帖选项:</td>
    <td class="block_right">
      {if $channel_info.if_face == "1"}<input type="checkbox" id="if_face" name="if_face" value="1" {if $post_info.if_face == "1"}checked{/if} class="checkbox">允许识别表情符号<span id="if_face_return"><span class="prompt_primal"></span></span><br>{/if}
      {if $channel_info.if_bbcode == "1"}<input type="checkbox" id="if_bbcode" name="if_bbcode" value="1" {if $post_info.if_bbcode == "1"}checked{/if} class="checkbox">允许识别BBCODE<span id="if_bbcode_return"><span class="prompt_primal"></span></span><br>{/if}
      {if $channel_info.if_url == "1"}<input type="checkbox" id="if_url" name="if_url" value="1" {if $post_info.if_url == "1"}checked{/if} class="checkbox">允许识别URL<span id="if_url_return"><span class="prompt_primal"></span></span><br>{/if}
      {if $channel_info.if_html == "1"}<input type="checkbox" id="if_html" name="if_html" value="1" {if $post_info.if_html == "1"}checked{/if} class="checkbox">允许解析HTML<span id="if_html_return"><span class="prompt_primal"></span></span><br>{/if}
    </td>
  </tr>
  <tr>
    <td colspan="2" align="center" class="block_footer">
        <input type="button" id="button_submit" name="button_submit" value="编辑回帖" class="button"
        onclick="xajax.$('button_submit').disabled=true;
                 xajax.$('button_submit').value='请等待...';
                 xajax_submit_edit(xajax.getFormValues('form_edit'), 'button_submit');">
    </td>
  </tr>
</table>
</form>
{elseif $get.ope == "del"}
<form id="form_del" name="form_del" method="post" action="javascript:void(null);" enctype="multipart/form-data">
<table width="98%" cellpadding="3" cellspacing="0" border="0" align="center" class="block_group">
  <tr align="left" class="block_header">
    <td colspan="2">所在主题:<a href="{$control_index}?act=topic&topic_id={$topic_info.id}" target="_blank">{$topic_info.subject|str_entag:"space"}</a></td>
  </tr>
  </tr>
  <tr>
    <td width="20%" class="block_left" valign="top"><br />回帖内容:</td>
    <td width="80%" class="block_right">
    <table width="100%" height="20" cellpadding="0" cellspacing="0" border="0" align="center">
      <tr>
        <td width="16" nowrap><img src="{$dir_images}/icon_time.gif" border="0" alt="发表时间作者:" title="发表时间作者" /></td>
        <td width="100%" align="left"><a href="index.php?act=topic&topic_id={$post_info.topic_id}&post_id={$post_info.id}&#pid_{$post_info.id}" target="_blank">{$post_info.post_time|date_format:'%Y-%m-%d %H:%M:%S'}</a> 由 <a href="index.php?act=member_view&mid={$post_info.post_mid}" target="_blank">{$post_info.post_musername}</a> 发表:</td>
      </tr>
      <tr>
        <td colspan="2" height="30" align="left" valign="top">
        <table cellpadding="0" cellspacing="0" border="0" class="topic_content">
          <tr>
            <td align="left" valign="top">
            {assign var="post_content" value=$post_info.content|str_entag:"space,br"}
            {if $post_info.post_if_bbcode == "1"}{assign var="post_content" value=$post_content|parse_bwbbcode}{/if}
            {$post_content}
            </td>
          </tr>
        </table>
        </td>
      </tr>
    </table>
    </td>
  </tr>
  {if $post_info.attach_list|@is_array && $post_info.attach_list|@count > 0}
  <tr>
    <td class="block_left" valign="top"><br />附件列表:</td>
    <td class="block_right">
    <table width="100%" cellpadding="3" cellspacing="1" border="0">
      {foreach name=attach_list from=$post_info.attach_list item=attach_list}
      <tr align="center" bgcolor="#DEDEDE">
        <td width="5%">
        {if $attach_list.filename|substr:-4|in_array:".gif,.jpg,.png"}
          <img src="{$control_index}?act=attach&topic_id={$topic_info.id}&attach_id={$attach_list.id}" width="20" height="20" border="0" align="absmiddle">
        {/if}
        </td>
        <td width="95%" align="left">
          <table width="100%" height="25" cellspacing="0" cellpadding="0" border="0" class="content_wrap"><tr><td align="left"><div id="brief_{$attach_list.id}" name="brief_{$attach_list.id}" class="smalltext"><a href="{$control_index}?act=attach&topic_id={$topic_info.id}&attach_id={$attach_list.id}" target="_blank">{$attach_list.brief}</a></div></td></tr></table>
        </td>
      </tr>
      {/foreach}
    </table>
    </td>
  </tr>
  {/if}
  <tr>
    <td colspan="2" align="center" class="block_footer">
    <input type="button" id="button_submit" name="button_submit" value="删除回帖" class="button"
        onclick="xajax.$('button_submit').disabled=true;
                 xajax.$('button_submit').value='请等待...';
                 xajax_submit_del(xajax.getFormValues('form_del'), 'button_submit');">
    </td>
  </tr>
</table>
</form>
{/if}
</div>

{include file="pub_footer.htm"}
